i am not getting an output of reversed array from my code below